package com.bsxwl.controller;

import com.bsxwl.pojo.User;
import com.bsxwl.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    /*@Autowired
    private DataSource dataSource;

    @Value("${bsxwl.url}")
    private String bsxwlUrl;

    @Value("${falcon.url}")
    private String falconUrl;

    @GetMapping("hello")
    public String hello(){
        System.out.println("dataSource = " + dataSource);
        System.out.println("bsxwl.url = " + bsxwlUrl);
        System.out.println("falcon.url = " + falconUrl);

        return "hello, spring boot!";
    }*/

    @Autowired
    private UserService userService;

    @GetMapping("/user/{id}")
    public User findById(@PathVariable Integer id){
        return userService.findById(id);
    }
}
